package com.liang.blog.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.liang.blog.utils.DateUtils;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
public class BlogInfo {
    private Integer id;
    @NotBlank(message = "title不能为空")
    private String title;
    @NotBlank(message = "content不能为空")
    private String content;
    private Integer userId;
    private Integer deleteFlag;
    private boolean isLoginUser;
    private Date createTime;
    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;
    private String userName;
    private String kind;

//    public String getUpdateTime() {
//        return DateUtils.format(updateTime);
//    }
}
